package com.yh.blog.controller;

import com.yh.blog.service.FriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 友链前台展示控制层
 */
@Controller
public class FriendShowController {
    @Autowired
    private FriendService friendService;

//    跳转到友链列表
    @GetMapping("/friend")
    public String friend(Model model){
        model.addAttribute("friends",this.friendService.list());
        return "friends";
    }
}
